the right thing or return error if detected. A NULL cmdline, for example,
would currently generate a segfault.
Signed-off-by: Ben Thomas <bjthomas3@gmail.com>
start_info->mod_start = vinitrd_start;
start_info->mod_len = initrd_len;
}
- strncpy((char *)start_info->cmd_line, cmdline, MAX_GUEST_CMDLINE);
- start_info->cmd_line[MAX_GUEST_CMDLINE-1] = '\0';
+ if ( cmdline != NULL )
+ {
+ strncpy((char *)start_info->cmd_line, cmdline, MAX_GUEST_CMDLINE);
+ start_info->cmd_line[MAX_GUEST_CMDLINE-1] = '\0';
+ }
munmap(start_info, PAGE_SIZE);
/* shared_info page starts its life empty. */
char *image = NULL;
unsigned int bytes;
+ if ( filename == NULL )
+ goto out;
+
if ( (kernel_fd = open(filename, O_RDONLY)) < 0 )
{
PERROR("Could not open kernel image");